// ActionScript file
import mx.utils.ObjectUtil;

private function errorFunc(error:Object):void {
	
	Alert.show(ObjectUtil.toString(error));
}

private function generateFault():void {
  /*	apex.search("find what new account* } ", 
    	new AsyncResponder(
    	function search_Result(result:Object):void	{
		  	Alert.show('search Result\n' + ObjectUtil.toString(result));
		}, 
		function search_Fault(result:Fault):void	{
		  	Alert.show('EXPECTED: search Fault\n\n' + ObjectUtil.toString(result));
		}
		));*/
  }
  
  // handy for debugging soap messages
private function sendRequestListener(event:SendEvent):void {
	XML.prettyIndent = 4;
	XML.prettyPrinting = true;
	var x:XML = new XML(event.soapRequest);
//	trace("SOAP: \n" +  x.toString());
}

private function b64():void { 	
  trace("simple TEST BASE64 CODE:\n");
  
  var unEncoded:String = "This is a test string";
  trace(unEncoded + '\n');
  var encoded:String = Base64.encode( unEncoded );// works
  trace("encoded test string:	" + encoded + '\n');
  var decoded:String = new String( Base64.decode( encoded )) ; // fails

   trace('decoded test string:	' + decoded	+ '\n');
}
private function echoToDebugLog(event:DebugEvent):void {
  //	trace("DEBUG: " +  event.debugString + "\n");
}